﻿using UnityEngine;
using System.Collections;

public class PlayerControl : MonoBehaviour {
	//public int keyCount = 0;
	public IntVector2 gridPos;
	public bool canMove = true;
	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {
		if (canMove) {
			Vector3 pos = transform.localPosition;
			if (Input.GetKey (KeyCode.UpArrow) || Input.GetKey (KeyCode.W)) {
				pos.y += .12f;
			} else if (Input.GetKey (KeyCode.DownArrow) || Input.GetKey (KeyCode.S)) {
				pos.y -= .12f;
			} else if (Input.GetKey (KeyCode.LeftArrow) || Input.GetKey (KeyCode.A)) {
				pos.x -= .12f;	
			} else if (Input.GetKey (KeyCode.RightArrow) || Input.GetKey (KeyCode.D)) {
				pos.x += .12f;
			}
			transform.localPosition = pos;
		}
	}
}
